load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "testkit",
    srcs = [
        "asynctestkit.go",
        "dbtestkit.go",
        "mocksessionmanager.go",
        "mockstore.go",
        "result.go",
        "stepped.go",
        "testkit.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/testkit",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ddl/schematracker",
        "//pkg/domain",
        "//pkg/expression",
        "//pkg/kv",
        "//pkg/parser/ast",
        "//pkg/parser/auth",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/planner/core",
        "//pkg/planner/core/resolve",
        "//pkg/resourcemanager",
        "//pkg/session",
        "//pkg/session/txninfo",
        "//pkg/session/types",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/store/driver",
        "//pkg/store/helper",
        "//pkg/store/mockstore",
        "//pkg/testkit/testenv",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/breakpoint",
        "//pkg/util/chunk",
        "//pkg/util/gctuner",
        "//pkg/util/intest",
        "//pkg/util/logutil",
        "//pkg/util/metricsutil",
        "//pkg/util/sqlexec",
        "@com_github_gorilla_mux//:mux",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_tipb//go-binlog",
        "@com_github_prometheus_client_golang//prometheus/promhttp",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_client_go_v2//tikv",
        "@com_github_tikv_client_go_v2//tikvrpc",
        "@io_opencensus_go//stats/view",
        "@org_golang_google_grpc//:grpc",
        "@org_uber_go_atomic//:atomic",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "testkit_test",
    timeout = "short",
    srcs = ["testkit_test.go"],
    embed = [":testkit"],
    flaky = True,
    deps = ["@com_github_stretchr_testify//require"],
)
